<% if page.redirects_to_external? %>
  <%= link_to(
    h(page.name),
    page.external_urlname,
    title: options[:show_title] == true ? page.title : nil,
    target: configuration(:open_external_links_in_new_tab) ? '_blank' : nil,
    class: external_page_css_class(page)
  ) %>
<% else %>
  <%= link_to(
    h(page.name),
    @preview_mode ? 'javascript: void(0)' : show_alchemy_page_path(page),
    {
      class: (page_active?(page) ? 'active' : nil),
      title: (options[:show_title] ? page.title : nil),
      data: {'page-id' => page.id}
    }
  ) %>
<% end %>
